import request from '@/router/axios';

// 供货管理列表
export const getSupplyManagementList = (supplierName,current, size, params) => {
  return request({
    url: '/api/blade-portal/supplymanagement/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      supplierName
    }
  })
}

//查看
export const detailPage = (id) => {
  return request({
    url: '/api/blade-portal/supplymanagement/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const details = (sendNo) => {
  return request({
    url: '/api/blade-portal/requireplan/listCountMaterials',
    method: 'get',
    params: {
      sendNo,
    }
  })
}
export const detail = (supplyId) => {
  return request({
    url: '/api/blade-portal/supplymanagementdetail/list',
    method: 'get',
    params: {
      supplyId
    }
  })
}



//发货与取消发货
export const changeStatus = (ids,state) => {
  return request({
    url: '/api/blade-portal/supplymanagement/changeStatus',
    method: 'get',
    params: {
      ids,
      state
    }
  })
}

// 上传质检报告
export const uploadInspectionReport = (data) => {
  return request({
    url: '/api/blade-portal/supplymanagement/uploadInspectionReport',
    method: 'post',
    data
  })
}

// 上传质检报告(新)
export const uploadInspectionReportNew = (data) => {
  return request({
    url: '/api/blade-portal/supplymanagementdetail/update-inspection-report',
    method: 'post',
    data
  })
}

// 物料编码装箱信息
export const getBoxingInfo = (detailId) => {
  return request({
    url: '/api/blade-portal/supplymanagement/boxing',
    method: 'get',
    params: {
      detailId,
    }
  })
}

// 编辑物料生产批次和生产日期
export const updateSupplyManagementDetail = (data) => {
  return request({
    url: '/api/blade-portal/supplymanagement/updateSupplyManagementDetail',
    method: 'post',
    data
  })
}

// 打印箱单
export const printBoxs = (id) => {
  return request({
    url: '/api/blade-portal/print/printBoxs',
    method: 'post',
    params: {
      id
    },
    responseType:'blob',
  })
}
// 补打箱单
export const printBox = (data) => {
  return request({
    url: '/api/blade-portal/print/printBox',
    method: 'post',
    data,
    responseType:'blob',
  })
}
// 打印供货单
export const printSupplyList = (data) => {
  return request({
    url: '/api/blade-portal/print/printBillPdf',
    method: 'post',
    data,
    responseType:'blob',
  })
}

export const changeRealNum = (data) => {
  return request({
    url: '/api/blade-portal/supplymanagementbox/update',
    method: 'post',
    data:data,
  })
}
